//
//  RedViewController.m
//  导航控制器(storyboard)
//
//  Created by 伍银荣 on 2021/6/23.
//  Copyright © 2021 com.example. All rights reserved.
//

#import "RedViewController.h"
#import "GreenViewController.h"

@interface RedViewController ()
@property (strong, nonatomic) IBOutlet UITextField *textField;

@end

@implementation RedViewController

//通过storyBoard拖线的方式实现跳转的时候就会调用这个方法
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    
    //使用segue传值
    GreenViewController *greenVC = segue.destinationViewController;
    
    greenVC.navigationItem.title = self.textField.text;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
